﻿using System;
using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Data;

using JobGlance.Persistence.Admin;
using JobGlance.Common;
using JobGlance.Common.Model;
using JobGlance.Common.Model.Admin;



namespace JobGlance.BusinessRules.Admin
{
    public class AdminBC
    {
        #region RequestContext
        private RequestContext _requestContext;
        private AdminDAC _adminDac;

        /// <summary>
        /// Gets the admin dac.
        /// </summary>
        /// <value>The admin dac.</value>
        private AdminDAC adminDAC
        {
            get
            {
                if (_adminDac == null)
                    _adminDac = new AdminDAC(_requestContext);

                return _adminDac;
            }

        }
        /// <summary>
        /// Initializes a new instance of the <see cref="AdminBC"/> class.
        /// </summary>
        /// <param name="requestContext">The request context.</param>
        public AdminBC(RequestContext requestContext)
        {
            _requestContext = requestContext;
        }        
        #endregion

        #region GetRecruiter Result
        /// <summary>
        /// Gets the recruiter.
        /// </summary>        
        public List<RecruiterResult> GetRecruiterResult()
        {
            return adminDAC.GetRecruiterResult();
        }
        #endregion

        #region GetJobseeker Result
        /// <summary>
        /// Gets the jobseeker.
        /// </summary>        
        public List<JobseekerResult> GetJSResult()
        {
            return adminDAC.GetJSResult();
        }
        #endregion

        #region GetJobResult
        /// <summary>
        /// Gets the posted job detail and Qualifications required against that job.
        /// </summary>        
        public List<JobPostedResult> GetJobResult()
        {
            List<JobPostedResult> lst = adminDAC.GetJobResult();
            if (lst.Count > 0)
            {
                for (int i = 0; i < lst.Count; i++)
                {        
                    lst[i].Qualification = adminDAC.GetJobQualification(lst[i].RequiredEdu);
                }
            }
            return lst;
             
        }
        #endregion

        #region UpdateRecStatus
        /// <summary>
        /// Updates the rec active status.
        /// </summary>        
        public void UpdateRecStatus(RecruiterResult objRecruiterResult)
        {
            adminDAC.UpdateRecStatus(objRecruiterResult);
        }
        #endregion

        #region UpdateJSStatus
        /// <summary>
        /// Updates the js active status.
        /// </summary>       
        public void UpdateJSStatus(JobseekerResult objJobseekerResult)
        {
            adminDAC.UpdateJSStatus(objJobseekerResult);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="objFeedback"></param>
        public void InsertFeedback(Feedback objFeedback)
        {
           adminDAC.InsertFeedback(objFeedback);
        }
        #endregion
    }
}
